package com.voxel.sense.infomsg.view.dropmenu;

import android.graphics.drawable.Drawable;

/**
 * Created by ChenYiYao on 2018/7/2.
 */
public class Orientation {
    private Drawable mUnselectedDraw;
    private Drawable mSelectedDraw;
    private int mOrientation;

    public static final int left = 0;
    public static final int top = 1;
    public static final int right = 2;
    public static final int bottom = 3;

    public Orientation() {
    }

    public Drawable getLeft(boolean close) {
        return mOrientation == left ? (close ? mUnselectedDraw : mSelectedDraw) : null;
    }


    public Drawable getTop(boolean close) {
        return mOrientation == top ? (close ? mUnselectedDraw : mSelectedDraw) : null;
    }

    public Drawable getRight(boolean close) {
        return mOrientation == right ? (close ? mUnselectedDraw : mSelectedDraw) : null;
    }

    public Drawable getBottom(boolean close) {
        return mOrientation == bottom ? (close ? mUnselectedDraw : mSelectedDraw) : null;
    }

    public void init(int orientation, Drawable menuSelectedIcon, Drawable menuUnselectedIcon) {
        this.mUnselectedDraw = menuUnselectedIcon;
        this.mSelectedDraw = menuSelectedIcon;
        this.mOrientation = orientation;
    }
}
